#ifndef __HDVB_CHANSCAN_FACTORY_H
#define __HDVB_CHANSCAN_FACTORY_H
/*
    libhdvbd - Library for building sophisticated DVB applications
    Copyright (C) 2012 Tony Houghton <h@realh.co.uk>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

/* Enables specialised channel scanners to be registered by name. Built in
 * factories are "default", "Freeview" and "Freesat".
 */

#include <glib.h>

#include <hdvb/chanscantodb.h>
#include <hdvb/dbcommon.h>

G_BEGIN_DECLS

typedef HdvbChannelScan *(*HdvbChannelScanFactory)(void);

typedef HdvbChanScanToDb *(*HdvbScanToDbFactory)
        (sqlite3 *db, const char *factory);

/* name must be kept in memory as long as the app is running */
void
hdvb_chanscan_factory_register(const char *name,
        HdvbChannelScanFactory scanner_factory,
        HdvbDbCreator db_creator,
        HdvbScanToDbFactory chans_to_db_factory);

HdvbChannelScanFactory
hdvb_chanscan_factory_lookup_scanner(const char *name);

HdvbDbCreator
hdvb_chanscan_factory_lookup_db_creator(const char *name);

HdvbScanToDbFactory
hdvb_chanscan_factory_lookup_chans_to_db(const char *name);

G_END_DECLS

#endif /* __HDVB_CHANSCAN_FACTORY_H */

